import { createRouter, createWebHistory } from "vue-router";




export const routes= [
  {
    path: "/home",
    name: "首頁",
    component: () => import("@/components/layout.vue"),
    children: [
      {
        path: "drugstore",
        name: "药房管理",
        component: () => import("@/drugstore/index.vue"),
        children: [
          {
            path: "durg_medicine",
            name: "药房退药",
            component: () => import("@/drugstore/drug_medicine.vue"),
          },
          {
            path: "drug_storage",
            name: "药库管理",
            component: () => import("@/drugstore/drug_storage.vue"),
            // redirect:"/home/drugstore/drug_storage/search",
            // children:[
            //   {
            //     path:"search",
            //     component:()=>import("@/drugstore/drug_storage_search.vue")
            //   },
            //   {
            //     path:"add",
            //     component:()=>import("@/drugstore/drug_storage_add.vue")
            //   },
            // ]
          },
          {
            path: "give_medicine",
            name: "药房发药",
            component: () => import("@/drugstore/give_medicine.vue"),
          },
          {
            path: "tran_history",
            name: "交易记录",
            component: () => import("@/drugstore/tran_history.vue"),
          },
        ],
      },
      {
        path: "check",
        name: "检查管理",
        component: () => import("@/registration/check/index.vue"),
        
      },
      {
        path: "cli_doctor",
        name: "门诊医生",
        component: () => import("@/registration/cli_doctor/index.vue"),
      },
      {
        path: "disposal",
        name: "处置管理",
        component: () => import("@/registration/disposal/index.vue"),
      },
      {
        path: "examination",
        name: "检验管理",
        component: () => import("@/registration/examination/index.vue"),
      },
      {
        path: "fee",
        name: "挂号管理",
        component: () => import("@/registration/fee/index.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "登录",
    component: () => import("@/login/login.vue"),
  },
  {
    path:"/",
    redirect:"/home"
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes:routes
});
export default router;
